import request from "@/utils/request";

// 查询植物名称列表
export function listRelation(query) {
  return request({
    url: '/admin/relation/list',
    method: 'get',
    params: query
  })
}

// 查询植物名称详细
export function getRelation(relationId) {
  return request({
    url: '/admin/relation/' + relationId,
    method: 'get'
  })
}

export function listCrop(){
  return request({
    url: '/admin/relation/crop',
    method: 'get'
  })
}

// 新增植物名称
export function addRelation(data) {
  return request({
    url: '/admin/relation',
    method: 'post',
    data: data
  })
}

// 修改植物名称
export function updateRelation(data) {
  return request({
    url: '/admin/relation',
    method: 'put',
    data: data
  })
}

// 删除植物名称
export function delRelation(relationId) {
  return request({
    url: '/admin/relation/' + relationId,
    method: 'delete'
  })
}
